ci: add e2e workflow to deploy plugin to Mattermost and verify it starts#208
ci: add e2e workflow to deploy plugin to Mattermost and verify it starts#208lieut-data merged 4 commits intomasterfrom
Conversation
📝 WalkthroughWalkthroughA new GitHub Actions workflow file has been added to automate end-to-end deployment verification. The workflow provisions a PostgreSQL database and Mattermost server, deploys a plugin using pluginctl, and verifies the plugin's active status through REST API calls. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)
32-37: DerivePLUGIN_IDfrom the manifest once and reuse it everywhere.
build/setup.mk:13-17already resolves the plugin ID fromplugin.json, but this workflow keeps separate copies in the job env, config payload, deploy step, and assertion. If the manifest ID changes,make distwill build the new bundle while the rest of this workflow still targets the old ID.One way to keep a single source of truth
env: MM_SITEURL: http://localhost:8065 MM_ADMIN_USERNAME: admin MM_ADMIN_PASSWORD: Admin_1234! - PLUGIN_ID: com.mattermost.demo-plugin + - name: Resolve plugin ID + run: echo "PLUGIN_ID=$(./build/bin/manifest id)" >> "$GITHUB_ENV" ... - curl -sf -X PUT ${{ env.MM_SITEURL }}/api/v4/config/patch \ + cat >/tmp/plugin-config.json <<EOF + { + "PluginSettings": { + "Plugins": { + "$PLUGIN_ID": { + "username": "demouser", + "channelname": "demo", + "lastname": "User" + } + } + } + } + EOF + curl -sf -X PUT ${{ env.MM_SITEURL }}/api/v4/config/patch \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ - -d '{ - "PluginSettings": { - "Plugins": { - "com.mattermost.demo-plugin": { - "username": "demouser", - "channelname": "demo", - "lastname": "User" - } - } - } - }' + --data `@/tmp/plugin-config.json`Also applies to: 104-117, 126-126, 145-150
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/e2e.yml around lines 32 - 37, The workflow currently hardcodes PLUGIN_ID in multiple places; change it to derive the ID once from plugin.json and reuse that variable across the job (replace the env PLUGIN_ID, the config payload, the deploy step, and the assertion). Read the plugin manifest (plugin.json) at job runtime (similar to build/setup.mk's logic) and export the derived value as a single PLUGIN_ID environment variable for the job, then reference that environment variable everywhere instead of hardcoding the ID.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/e2e.yml:
- Line 71: Replace the mutable image reference
"mattermost/mattermost-enterprise-edition:latest" used for the Mattermost
service with a pinned release tag and digest (for example matching the
plugin.json min_server_version 7.9.0), i.e. change the image string to a
specific "mattermost/mattermost-enterprise-edition:<version>@sha256:<digest>" so
the CI is reproducible; locate the literal
"mattermost/mattermost-enterprise-edition:latest" in the e2e.yml service
definition and update it to the chosen pinned tag+digest (or add a
variable/lookup that resolves to a pinned digest) ensuring it matches a tested
Mattermost release.
---
Nitpick comments:
In @.github/workflows/e2e.yml:
- Around line 32-37: The workflow currently hardcodes PLUGIN_ID in multiple
places; change it to derive the ID once from plugin.json and reuse that variable
across the job (replace the env PLUGIN_ID, the config payload, the deploy step,
and the assertion). Read the plugin manifest (plugin.json) at job runtime
(similar to build/setup.mk's logic) and export the derived value as a single
PLUGIN_ID environment variable for the job, then reference that environment
variable everywhere instead of hardcoding the ID.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 57bb6991-bc72-426a-b4c8-d48dd6cec49d
📒 Files selected for processing (1)
.github/workflows/e2e.yml
DHaussermann
left a comment
There was a problem hiding this comment.
Tested and passed
@lieut-data can see the E2E check is green.
There's not much more in terms of functional testing I can think to do as it's mostly a build time change.
LGTM!
Summary
e2eGitHub Actions workflow that spins up a Mattermost Enterprise Edition container backed by PostgreSQL, deploys the demo plugin, and asserts it appears in the active plugins listlinux-amd64server binary (viaMM_SERVICESETTINGS_ENABLEDEVELOPER=true) to keep the job fastTest plan
e2eworkflow passes on this PR